<?php

namespace AppBundle\Controller;

use AppBundle\Form\Type\TestedType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

class DefaultController extends Controller
{
    /**
     * @Route("/", name="homepage")
     */
    public function indexAction(Request $request)
    {
        $formData=array();
        $form = $this->createForm(TestedType::class,$formData);


        $form->handleRequest($request);

        if($form->isSubmitted() && $form->isValid()){
            $this->get('logger')->debug('submit');
        }
        // replace this example code with whatever you need
        return $this->render('default/index.html.twig', array(
            'form' => $form->createView(),
            'base_dir' => realpath($this->container->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
        ));
    }
}
